package com.lyn.mango;

import com.feizhou.swagger.annotation.ApiOperation;
import com.feizhou.swagger.annotation.Param;
import com.lyn.common.base.BaseController;
import com.lyn.common.base.Result;

public class MangoController extends BaseController {

    MangoService srv = MangoService.me;

    @ApiOperation(url = "/insert", httpMethod = "post", description = "新增一行记录")
    @Param(name = "data", description = "新增一行记录", required = true, dataType = "string")
    public void insert() {
        Result result = srv.insert(getPara("data"));
        renderJson(result);
    }

    @ApiOperation(url = "/getById", httpMethod = "get", description = "获取单条记录的信息")
    @Param(name = "id", description = "获取单条记录的信息", required = true, dataType = "string")
    public void getById() {
        String id = getPara("id");
        Result result = srv.getById(id);
        renderJson(result);
    }

    @ApiOperation(url = "/mangoInsert", httpMethod = "post", description = "mango新增一行记录")
    @Param(name = "data", description = "mango新增一行记录", required = true, dataType = "string")
    public void mangoInsert() {
        srv.mangoInsert(getPara("data"));
        renderJson();
    }

    @ApiOperation(url = "/mangoSum", httpMethod = "get", description = "mangoSum")
    @Param(name = "dwdm", description = "mangoSum", required = true, dataType = "string")
    public void mangoSum() {
        String dwdm = getPara("dwdm");
        srv.mangoGet(dwdm);
        renderJson();
    }
}
